package com.shadow.core.delegate.bottom;


import com.shadow.core.delegate.ShadowDelegate;
import com.shadow.core.util.toast.ToastUtils;

/**
 * @author zhangyu
 * @date 2017/10/27
 */

public abstract class BottomItemDelegate extends ShadowDelegate {

    private long mExitTime = 0;
    private static final long INTERVAL_TIME = 2000;

    @Override
    public boolean onBackPressedSupport() {
        if (System.currentTimeMillis() - mExitTime < INTERVAL_TIME) {
            _mActivity.finish();
        } else {
            mExitTime = System.currentTimeMillis();
            ToastUtils.showToast(getContext(), "再按一次退出程序");
        }
        return true;
    }
}
